package com.ruoyi.web.controller.biz;

import com.ruoyi.biz.domain.BizTopicFollow;
import com.ruoyi.biz.service.BizTopicFollowService;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;


/**
 * 子课题跟进详情Controller
 * 
 * @author tianl
 * @date 2024-12-30
 */
@RestController
@RequestMapping("/biz/bizTopicFollow")
public class BizTopicFollowController extends BaseController {
    @Autowired
    private BizTopicFollowService bizTopicFollowService;

    /**
     * 子课题全部列表
     */
    @GetMapping(value = "/listAll")
    public AjaxResult listAll(BizTopicFollow bizTopic) {
        return success(bizTopicFollowService.list(bizTopic));
    }


    /**
     * 新增子课题
     */
    
    @Log(title = "子课题", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody BizTopicFollow bizTopic) {
        bizTopicFollowService.beforeSave(bizTopic);
        return AjaxResult.success();
    }


    /**
     * 删除子课题
     */
    
    @Log(title = "子课题", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids) {
        return toAjax(bizTopicFollowService.deleteByIds(ids));
    }
}
